package com.example.game.gamehit.util;

import android.content.Context;
import android.util.TypedValue;
import android.widget.TextView;
import android.widget.Toast;

public class ToastUtil {

	/**
	 * 短时显示
	 * @param context	上下文
	 * @param msg	提示内容
	 */
	public static void showShort(Context context, String msg){
		Toast toast = new Toast(context);
		TextView view = new TextView(context);
		view.setText(msg);
		view.setTextSize(TypedValue.COMPLEX_UNIT_DIP,24);
		toast.setView(view);
		toast.setDuration(Toast.LENGTH_SHORT);
		toast.show();
		
	}
	
	/**
	 * 长时显示
	 * @param context	上下文
	 * @param msg	提示内容
	 */
	public static void showLong(Context context, String msg){
		Toast toast = new Toast(context);
		TextView view = new TextView(context);
		view.setText(msg);
		view.setTextSize(TypedValue.COMPLEX_UNIT_DIP,24);
		toast.setView(view);
		toast.setDuration(Toast.LENGTH_LONG);
		toast.show();
	}
	
}
